﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using CrystalDecisions.CrystalReports.Engine;
using System.Data.SqlClient;

public partial class Reportes_VisualizadorReportes : System.Web.UI.Page
{
    //protected ReportDocument reporte;
    //protected ReportData reportData;
    //protected string GetConnectionString()
    //{
    //    System.Configuration.Configuration rootWebConfig =
    //        System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/TVMedia3Web");
    //    System.Configuration.ConnectionStringSettings connString;
    //    if (0 < rootWebConfig.ConnectionStrings.ConnectionStrings.Count)
    //    {
    //        connString = rootWebConfig.ConnectionStrings.ConnectionStrings["bdtvmediaSConnectionString"];
    //        if (null != connString)
    //            return connString.ToString();
    //        else
    //            return null;
    //    }
    //    return null;

    //}
    //protected void Page_Load(object sender, EventArgs e)
    //{
    //    if (!IsPostBack)
    //    {
    //        this.Title=Session["Titulo"].ToString();
    //    }
        
        
    //    reportData = (ReportData)Session[ReportData.SessionReportDataKey];
    //    reporte = new ReportDocument();
    //    reporte.Load(reportData.ReportPath);
    //    string stringconnection = GetConnectionString();
    //    SqlConnection connection = new SqlConnection(stringconnection);
    //    SqlCommand select = new SqlCommand(reportData.ReportSelect);
    //    select.CommandType = CommandType.Text;
    //    select.Connection = connection;
    //    connection.Open();
    //    SqlDataAdapter adapter = new SqlDataAdapter(select);
    //    DataSet ds = new DataSet();
    //    adapter.Fill(ds, reportData.TableName);
    //    reporte.SetDataSource(ds.Tables[reportData.TableName]);
    //    CrystalReportViewer1.ReportSource = reporte;
    //}

}
